package com.dragon.methodquote;

import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function;

/**
 * @author dragon
 * @version V1.0.0-RELEASE
 * @date 2019/5/30 17:47
 */
public class Test {

    public static void main(String[] args) {
//        System.exit(1);
        Consumer<Integer> c = i -> System.out.println(i);
//        c.accept(1);

        Consumer<Integer> c1 = System::exit;
//        c1.accept(0);
        Person person = new Person();
        Consumer<String> c2 = person::setName;
        c2.accept("dragon");
        System.out.println("person的姓名:" + person.getName());
        System.out.println("程序结束了");

        Function<Person, String> function = Person::getName;
        function.apply(person);

        Function<Person, String> function1 = Person::getName;

        List<Integer> arrayList = Arrays.asList(1, 2, 34, 2, 1, 412, 134);
        arrayList.forEach(System.out::println);
    }
}
